package com.dream.fly.juststartpractice.config;

/**
 * @author: 熊海梦
 * @date: 2018/11/8 15:20
 **/
public class WebApiResponse<T> {

    private Integer code;
    private String message;
    private String url;
    private T data;

    public static <T> WebApiResponse<T> success(){
        WebApiResponse<T> response = new WebApiResponse<>();
        response.setCode(200);
        response.setMessage("success");
        return response;
    }

    public static <T> WebApiResponse<T> success(T data){
        WebApiResponse<T> response = new WebApiResponse<>();
        response.setCode(200);
        response.setMessage("success");
        response.setData(data);
        return response;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
